﻿#ifndef EFFICENCYDIALOG_H
#define EFFICENCYDIALOG_H

#include <QDialog>
#include<QtCharts/QChartView>
#include <QtCharts/QPieSeries>
#include <QtCharts/QPieSlice>
#include<QMainWindow>
#include"taskmanager.h"
QT_CHARTS_USE_NAMESPACE


namespace Ui {
class EfficencyDialog;
}

class EfficencyDialog : public QDialog
{
    Q_OBJECT

    struct mymap{
        mymap()
        {
            tsakname=0.0;
            usedtime=0.0;
        }
        QString tsakname;
        mutable double usedtime;
    };
public:
    explicit EfficencyDialog(int switchfastpoint,QWidget *parent = 0);
    ~EfficencyDialog();
    //计算指令效率
    bool CalEfficiency();
    //显示界面
    void showEfficiency(double totalTime=0);
public slots:
   void  doublespinbox_valuechange();

private:
    Ui::EfficencyDialog *ui;
    QVector<TaskItem *> mvctaskItem;
    QVector<CommandItem *> mvctCmds;
    QList<mymap> mylist;
    int miswitch;

};

#endif // EFFICENCYDIALOG_H
